{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 23,
   "outputs": [],
   "source": [
    "import pandas as pd"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "outputs": [
    {
     "data": {
      "text/plain": "          货号  商品代码  颜色代码  商品名称 品牌   成本  季节  商品年份\n0   QTVW5600  QTVW  5600   羽绒服  A  180  冬季  2018\n1   AXTB3200  AXTB  3200    棉服  B   90  冬季  2019\n2   VBOY1800  VBOY  1800   家居服  C  120  冬季  2018\n3   HWLA4700  HWLA  4700  长袖T恤  A   30  秋季  2020\n4   XDQV5600  XDQV  5600    卫衣  B   56  春季  2019\n5   XHQA3700  XHQA  3700  羊毛大衣  C  200  冬季  2018\n6   UQNA9200  UQNA  9200    毛衣  B   68  春季  2020\n7   FLHR1800  FLHR  1800  短袖T恤  A   25  夏季  2019\n8   LCHM9800  LCHM  9800  保暖内衣  B   50  冬季  2018\n9   AGDH5500  AGDH  5500   牛仔裤  C   80  四季  2019\n10  YZFM1200  YZFM  1200    夹克  B   70  秋季  2019\n11  PWDK9200  PWDK  9200  运动长裤  B   60  四季  2020",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>货号</th>\n      <th>商品代码</th>\n      <th>颜色代码</th>\n      <th>商品名称</th>\n      <th>品牌</th>\n      <th>成本</th>\n      <th>季节</th>\n      <th>商品年份</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>QTVW5600</td>\n      <td>QTVW</td>\n      <td>5600</td>\n      <td>羽绒服</td>\n      <td>A</td>\n      <td>180</td>\n      <td>冬季</td>\n      <td>2018</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>AXTB3200</td>\n      <td>AXTB</td>\n      <td>3200</td>\n      <td>棉服</td>\n      <td>B</td>\n      <td>90</td>\n      <td>冬季</td>\n      <td>2019</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>VBOY1800</td>\n      <td>VBOY</td>\n      <td>1800</td>\n      <td>家居服</td>\n      <td>C</td>\n      <td>120</td>\n      <td>冬季</td>\n      <td>2018</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>HWLA4700</td>\n      <td>HWLA</td>\n      <td>4700</td>\n      <td>长袖T恤</td>\n      <td>A</td>\n      <td>30</td>\n      <td>秋季</td>\n      <td>2020</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>XDQV5600</td>\n      <td>XDQV</td>\n      <td>5600</td>\n      <td>卫衣</td>\n      <td>B</td>\n      <td>56</td>\n      <td>春季</td>\n      <td>2019</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>XHQA3700</td>\n      <td>XHQA</td>\n      <td>3700</td>\n      <td>羊毛大衣</td>\n      <td>C</td>\n      <td>200</td>\n      <td>冬季</td>\n      <td>2018</td>\n    </tr>\n    <tr>\n      <th>6</th>\n      <td>UQNA9200</td>\n      <td>UQNA</td>\n      <td>9200</td>\n      <td>毛衣</td>\n      <td>B</td>\n      <td>68</td>\n      <td>春季</td>\n      <td>2020</td>\n    </tr>\n    <tr>\n      <th>7</th>\n      <td>FLHR1800</td>\n      <td>FLHR</td>\n      <td>1800</td>\n      <td>短袖T恤</td>\n      <td>A</td>\n      <td>25</td>\n      <td>夏季</td>\n      <td>2019</td>\n    </tr>\n    <tr>\n      <th>8</th>\n      <td>LCHM9800</td>\n      <td>LCHM</td>\n      <td>9800</td>\n      <td>保暖内衣</td>\n      <td>B</td>\n      <td>50</td>\n      <td>冬季</td>\n      <td>2018</td>\n    </tr>\n    <tr>\n      <th>9</th>\n      <td>AGDH5500</td>\n      <td>AGDH</td>\n      <td>5500</td>\n      <td>牛仔裤</td>\n      <td>C</td>\n      <td>80</td>\n      <td>四季</td>\n      <td>2019</td>\n    </tr>\n    <tr>\n      <th>10</th>\n      <td>YZFM1200</td>\n      <td>YZFM</td>\n      <td>1200</td>\n      <td>夹克</td>\n      <td>B</td>\n      <td>70</td>\n      <td>秋季</td>\n      <td>2019</td>\n    </tr>\n    <tr>\n      <th>11</th>\n      <td>PWDK9200</td>\n      <td>PWDK</td>\n      <td>9200</td>\n      <td>运动长裤</td>\n      <td>B</td>\n      <td>60</td>\n      <td>四季</td>\n      <td>2020</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 24
    }
   ],
   "source": [
    "pd.read_excel('goods_base.xlsx')\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "outputs": [
    {
     "data": {
      "text/plain": "   月份   销量    销量额\n0   3  600  50000",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>月份</th>\n      <th>销量</th>\n      <th>销量额</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>3</td>\n      <td>600</td>\n      <td>50000</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 25
    }
   ],
   "source": [
    "pd.read_excel('sheet_name.xlsx',sheet_name=2)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%  sheet_name\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "outputs": [
    {
     "data": {
      "text/plain": "   月份   销量    销量额\n0   3  600  50000",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>月份</th>\n      <th>销量</th>\n      <th>销量额</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>3</td>\n      <td>600</td>\n      <td>50000</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 26
    }
   ],
   "source": [
    "pd.read_excel('sheet_name.xlsx',sheet_name='3月')"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "outputs": [
    {
     "data": {
      "text/plain": "   月份   销量    销量额\n0   2  812  60860",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>月份</th>\n      <th>销量</th>\n      <th>销量额</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>2</td>\n      <td>812</td>\n      <td>60860</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 27
    }
   ],
   "source": [
    "df_dict = pd.read_excel('sheet_name.xlsx',sheet_name=[1, '3月'])\n",
    "df_dict[1]"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "outputs": [
    {
     "data": {
      "text/plain": "   月份   销量    销量额\n0   3  600  50000",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>月份</th>\n      <th>销量</th>\n      <th>销量额</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>3</td>\n      <td>600</td>\n      <td>50000</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 28
    }
   ],
   "source": [
    "df_dict['3月']"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "outputs": [
    {
     "data": {
      "text/plain": "OrderedDict([('1月',    月份   销量    销量额\n              0   1  875  68860), ('2月',    月份   销量    销量额\n              0   2  812  60860), ('3月',    月份   销量    销量额\n              0   3  600  50000)])"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 29
    }
   ],
   "source": [
    "df_dict = pd.read_excel('sheet_name.xlsx',sheet_name=None)\n",
    "df_dict"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "outputs": [
    {
     "data": {
      "text/plain": "   月份   销量    销量额\n0   3  600  50000",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>月份</th>\n      <th>销量</th>\n      <th>销量额</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>3</td>\n      <td>600</td>\n      <td>50000</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 30
    }
   ],
   "source": [
    "df_dict['3月']\n",
    "\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "outputs": [
    {
     "data": {
      "text/plain": "   0    1      2\n0  1  875  65860\n1  2  820  68870\n2  3  877  70900",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>0</th>\n      <th>1</th>\n      <th>2</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>1</td>\n      <td>875</td>\n      <td>65860</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>2</td>\n      <td>820</td>\n      <td>68870</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>3</td>\n      <td>877</td>\n      <td>70900</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 31
    }
   ],
   "source": [
    "pd.read_excel('header.xlsx', header=None)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%  header\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "outputs": [
    {
     "data": {
      "text/plain": "   月份   销量    销售额\n0   1  875  65860\n1   2  820  68870\n2   3  877  70900",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>月份</th>\n      <th>销量</th>\n      <th>销售额</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>1</td>\n      <td>875</td>\n      <td>65860</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>2</td>\n      <td>820</td>\n      <td>68870</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>3</td>\n      <td>877</td>\n      <td>70900</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 32
    }
   ],
   "source": [
    "pd.read_excel('header.xlsx',sheet_name=1)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "outputs": [
    {
     "data": {
      "text/plain": "   月份   销量    销售额\n0   1  875  65860\n1   2  820  68870\n2   3  877  70900",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>月份</th>\n      <th>销量</th>\n      <th>销售额</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>1</td>\n      <td>875</td>\n      <td>65860</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>2</td>\n      <td>820</td>\n      <td>68870</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>3</td>\n      <td>877</td>\n      <td>70900</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 33
    }
   ],
   "source": [
    "pd.read_excel('header.xlsx',sheet_name=2, header=1)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "outputs": [
    {
     "data": {
      "text/plain": "     销量         销售额       \n月份   京东   天猫     京东     天猫\n1   400  875  42860  65860\n2   450  820  46870  68870\n3   430  877  50900  70900",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead tr th {\n        text-align: left;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr>\n      <th></th>\n      <th colspan=\"2\" halign=\"left\">销量</th>\n      <th colspan=\"2\" halign=\"left\">销售额</th>\n    </tr>\n    <tr>\n      <th>月份</th>\n      <th>京东</th>\n      <th>天猫</th>\n      <th>京东</th>\n      <th>天猫</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>1</th>\n      <td>400</td>\n      <td>875</td>\n      <td>42860</td>\n      <td>65860</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>450</td>\n      <td>820</td>\n      <td>46870</td>\n      <td>68870</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>430</td>\n      <td>877</td>\n      <td>50900</td>\n      <td>70900</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 34
    }
   ],
   "source": [
    "pd.read_excel('header.xlsx',sheet_name=3,header=[0, 1],index_col=0)\n",
    "\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "outputs": [
    {
     "data": {
      "text/plain": "   AAA  BBB  CCC  DDD  EEE\n0   10   20   30   40   50\n1   60   70   80   90  100",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>AAA</th>\n      <th>BBB</th>\n      <th>CCC</th>\n      <th>DDD</th>\n      <th>EEE</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>10</td>\n      <td>20</td>\n      <td>30</td>\n      <td>40</td>\n      <td>50</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>60</td>\n      <td>70</td>\n      <td>80</td>\n      <td>90</td>\n      <td>100</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 35
    }
   ],
   "source": [
    "pd.read_excel('usecols.xlsx')"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%  usecols\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "outputs": [
    {
     "data": {
      "text/plain": "   BBB  CCC  DDD  EEE\n0   20   30   40   50\n1   70   80   90  100",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>BBB</th>\n      <th>CCC</th>\n      <th>DDD</th>\n      <th>EEE</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>20</td>\n      <td>30</td>\n      <td>40</td>\n      <td>50</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>70</td>\n      <td>80</td>\n      <td>90</td>\n      <td>100</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 36
    }
   ],
   "source": [
    "pd.read_excel('usecols.xlsx',usecols='B:E')"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "outputs": [
    {
     "data": {
      "text/plain": "   AAA  CCC\n0   10   30\n1   60   80",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>AAA</th>\n      <th>CCC</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>10</td>\n      <td>30</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>60</td>\n      <td>80</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 37
    }
   ],
   "source": [
    "pd.read_excel('usecols.xlsx',usecols=[0, 2])"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "outputs": [
    {
     "data": {
      "text/plain": "   AAA  CCC\n0   10   30\n1   60   80",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>AAA</th>\n      <th>CCC</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>10</td>\n      <td>30</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>60</td>\n      <td>80</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 38
    }
   ],
   "source": [
    "pd.read_excel('usecols.xlsx',usecols=['AAA', 'CCC'])"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "outputs": [
    {
     "data": {
      "text/plain": "   AAA  EEE\n0   10   50\n1   60  100",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>AAA</th>\n      <th>EEE</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>10</td>\n      <td>50</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>60</td>\n      <td>100</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 39
    }
   ],
   "source": [
    "pd.read_excel('usecols.xlsx', usecols=lambda x: (x=='AAA') | (x=='EEE'))"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "outputs": [
    {
     "data": {
      "text/plain": "          货号  商品名称 品牌   成本  季节  商品年份\n0   QTVW5600   羽绒服  A  180  冬季  2018\n1   AXTB3200    棉服  B   90  冬季  2019\n2   VBOY1800   家居服  C  120  冬季  2018\n3   HWLA4700  长袖T恤  A   30  秋季  2020\n4   XDQV5600    卫衣  B   56  春季  2019\n5   XHQA3700  羊毛大衣  C  200  冬季  2018\n6   UQNA9200    毛衣  B   68  春季  2020\n7   FLHR1800  短袖T恤  A   25  夏季  2019\n8   LCHM9800  保暖内衣  B   50  冬季  2018\n9   AGDH5500   牛仔裤  C   80  四季  2019\n10  YZFM1200    夹克  B   70  秋季  2019\n11  PWDK9200  运动长裤  B   60  四季  2020",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>货号</th>\n      <th>商品名称</th>\n      <th>品牌</th>\n      <th>成本</th>\n      <th>季节</th>\n      <th>商品年份</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>QTVW5600</td>\n      <td>羽绒服</td>\n      <td>A</td>\n      <td>180</td>\n      <td>冬季</td>\n      <td>2018</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>AXTB3200</td>\n      <td>棉服</td>\n      <td>B</td>\n      <td>90</td>\n      <td>冬季</td>\n      <td>2019</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>VBOY1800</td>\n      <td>家居服</td>\n      <td>C</td>\n      <td>120</td>\n      <td>冬季</td>\n      <td>2018</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>HWLA4700</td>\n      <td>长袖T恤</td>\n      <td>A</td>\n      <td>30</td>\n      <td>秋季</td>\n      <td>2020</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>XDQV5600</td>\n      <td>卫衣</td>\n      <td>B</td>\n      <td>56</td>\n      <td>春季</td>\n      <td>2019</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>XHQA3700</td>\n      <td>羊毛大衣</td>\n      <td>C</td>\n      <td>200</td>\n      <td>冬季</td>\n      <td>2018</td>\n    </tr>\n    <tr>\n      <th>6</th>\n      <td>UQNA9200</td>\n      <td>毛衣</td>\n      <td>B</td>\n      <td>68</td>\n      <td>春季</td>\n      <td>2020</td>\n    </tr>\n    <tr>\n      <th>7</th>\n      <td>FLHR1800</td>\n      <td>短袖T恤</td>\n      <td>A</td>\n      <td>25</td>\n      <td>夏季</td>\n      <td>2019</td>\n    </tr>\n    <tr>\n      <th>8</th>\n      <td>LCHM9800</td>\n      <td>保暖内衣</td>\n      <td>B</td>\n      <td>50</td>\n      <td>冬季</td>\n      <td>2018</td>\n    </tr>\n    <tr>\n      <th>9</th>\n      <td>AGDH5500</td>\n      <td>牛仔裤</td>\n      <td>C</td>\n      <td>80</td>\n      <td>四季</td>\n      <td>2019</td>\n    </tr>\n    <tr>\n      <th>10</th>\n      <td>YZFM1200</td>\n      <td>夹克</td>\n      <td>B</td>\n      <td>70</td>\n      <td>秋季</td>\n      <td>2019</td>\n    </tr>\n    <tr>\n      <th>11</th>\n      <td>PWDK9200</td>\n      <td>运动长裤</td>\n      <td>B</td>\n      <td>60</td>\n      <td>四季</td>\n      <td>2020</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 40
    }
   ],
   "source": [
    "pd.read_excel('goods_base.xlsx',  usecols=['货号', '商品名称', '品牌', '成本', '季节', '商品年份'])\n",
    "\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%% ['货号', '商品名称', '品牌', '成本', '季节', '商品年份']\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "outputs": [
    {
     "data": {
      "text/plain": "   月份   销量    销售额\n0   1  875  65860\n1   2  820  68870\n2   3  877  70900",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>月份</th>\n      <th>销量</th>\n      <th>销售额</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>1</td>\n      <td>875</td>\n      <td>65860</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>2</td>\n      <td>820</td>\n      <td>68870</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>3</td>\n      <td>877</td>\n      <td>70900</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 41
    }
   ],
   "source": [
    "pd.read_excel('skiprows.xlsx',skiprows=1)\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%% skiprows\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "outputs": [
    {
     "data": {
      "text/plain": "   月份   销量    销售额\n0   1  875  65860\n1   2  820  68870\n2   3  877  70900",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>月份</th>\n      <th>销量</th>\n      <th>销售额</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>1</td>\n      <td>875</td>\n      <td>65860</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>2</td>\n      <td>820</td>\n      <td>68870</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>3</td>\n      <td>877</td>\n      <td>70900</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 42
    }
   ],
   "source": [
    "pd.read_excel('skiprows.xlsx',sheet_name=1,skiprows=[0, 2])"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "outputs": [
    {
     "data": {
      "text/plain": "   Unnamed: 0  月份   销量    销售额\n0         NaN   1  875  65860\n1         NaN   2  820  68870\n2         NaN   3  877  70900",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>Unnamed: 0</th>\n      <th>月份</th>\n      <th>销量</th>\n      <th>销售额</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>NaN</td>\n      <td>1</td>\n      <td>875</td>\n      <td>65860</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>NaN</td>\n      <td>2</td>\n      <td>820</td>\n      <td>68870</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>NaN</td>\n      <td>3</td>\n      <td>877</td>\n      <td>70900</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 43
    }
   ],
   "source": [
    "pd.read_excel('skiprows.xlsx',sheet_name=2,skiprows=2,skipcols=1)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "outputs": [
    {
     "data": {
      "text/plain": "   月份   销量    销售额\n0   1  875  65860\n1   2  820  68870\n2   3  877  70900",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>月份</th>\n      <th>销量</th>\n      <th>销售额</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>1</td>\n      <td>875</td>\n      <td>65860</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>2</td>\n      <td>820</td>\n      <td>68870</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>3</td>\n      <td>877</td>\n      <td>70900</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 44
    }
   ],
   "source": [
    "pd.read_excel('skiprows.xlsx',sheet_name=2,skiprows=2,usecols='B:D')\n",
    "\n",
    "\n",
    "\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  },
  "pycharm": {
   "stem_cell": {
    "cell_type": "raw",
    "source": [],
    "metadata": {
     "collapsed": false
    }
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}